﻿using System;
using System.Linq;
using AutoR.Services;
using LiteDB;

namespace AutoR.Models
{
	// Token: 0x020001FF RID: 511
	public class StatNewShip
	{
		// Token: 0x1700035D RID: 861
		// (get) Token: 0x06000B62 RID: 2914 RVA: 0x0006D332 File Offset: 0x0006B532
		// (set) Token: 0x06000B63 RID: 2915 RVA: 0x0006D33A File Offset: 0x0006B53A
		public ObjectId Id { get; set; } = ObjectId.NewObjectId();

		// Token: 0x1700035E RID: 862
		// (get) Token: 0x06000B64 RID: 2916 RVA: 0x0006D343 File Offset: 0x0006B543
		// (set) Token: 0x06000B65 RID: 2917 RVA: 0x0006D34B File Offset: 0x0006B54B
		public int Node { get; set; }

		// Token: 0x1700035F RID: 863
		// (get) Token: 0x06000B66 RID: 2918 RVA: 0x0006D354 File Offset: 0x0006B554
		// (set) Token: 0x06000B67 RID: 2919 RVA: 0x0006D35C File Offset: 0x0006B55C
		public string Flag { get; set; }

		// Token: 0x17000360 RID: 864
		// (get) Token: 0x06000B68 RID: 2920 RVA: 0x0006D365 File Offset: 0x0006B565
		// (set) Token: 0x06000B69 RID: 2921 RVA: 0x0006D36D File Offset: 0x0006B56D
		public int ShipCid { get; set; }

		// Token: 0x17000361 RID: 865
		// (get) Token: 0x06000B6A RID: 2922 RVA: 0x0006D376 File Offset: 0x0006B576
		// (set) Token: 0x06000B6B RID: 2923 RVA: 0x0006D37E File Offset: 0x0006B57E
		public int Count { get; set; }

		// Token: 0x17000362 RID: 866
		// (get) Token: 0x06000B6C RID: 2924 RVA: 0x0006D387 File Offset: 0x0006B587
		[BsonIgnore]
		public string Name
		{
			get
			{
				ShipConfig shipConfig = Runtime.Configs.shipCard.SingleOrDefault((ShipConfig s) => s.cid == this.ShipCid);
				if (shipConfig == null)
				{
					return null;
				}
				return shipConfig.title;
			}
		}
	}
}
